package com.gmsk.pocket.service.impl;

import com.gmsk.pocket.dao.DocTypeMapper;
import com.gmsk.pocket.entity.DocType;
import com.gmsk.pocket.service.DocTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DocTypeServiceImpl implements DocTypeService {

    @Autowired
    DocTypeMapper docTypeMapper;

    @Override
    public int insert(DocType docType) {
        return docTypeMapper.insert(docType);
    }

    @Override
    public int update(DocType docType) {
        return docTypeMapper.updateByPrimaryKey(docType);
    }

    @Override
    public int delete(Integer id) {
        return docTypeMapper.deleteByPrimaryKey(id);
    }

    @Override
    public DocType select(Integer id) {
        return docTypeMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<DocType> findRootList() {
        return docTypeMapper.findRootList();
    }

    @Override
    public List<DocType> selectByParent(Integer id) {
        return docTypeMapper.selectByParent(id);
    }

    @Override
    public Integer selectMaxSeq(Integer id) {
        return docTypeMapper.selectMaxSeq(id);
    }
}
